using System;
using System.Collections.Generic;
using System.Text;
using GRE.Framework;

namespace GRE.Logics
{
    public class AWord
    {
        private string _word = string.Empty;
        public string Literal
        {
            get
            {
                return StringHelper.CleanString(_word);
            }
        }
        public AWord(string word)
        {
            _word = word;
        }

        public AWord()
        {
            _word = string.Empty;
        }

        public override string ToString()
        {
            return StringHelper.CleanString(_word);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        private List<Meaning> _meaning = null;
        public List<Meaning> Meaning
        {
            get
            {
                if (_meaning == null)
                {
                    _meaning = new List<Meaning>();
                }
                return _meaning;
            }
        }
        public void AddMeaning(Meaning mnng)
        {
            if (_meaning == null)
            {
                _meaning = new List<Meaning>();
            }
            _meaning.Add(mnng);
        }

        private Etymology _etym = null;
        public Etymology Etymology
        {
            get
            {
                if (_etym == null)
                {
                    _etym = new Etymology();
                }
                return _etym;
            }
            set
            {
                _etym = value;
            }
        }

        public bool HasNoMeaning
        {
            get
            {
                if (_meaning == null)
                {
                    return true;
                }

                if (_meaning.Count == 0)
                {
                    return true;
                }

                return false;
            }
        }
    }
}
